function [ predictedLabels, continuousLabels, errors, actuals] = PredictLinearClassification( predictedWeightVector, data, labelToClassify )

[numDataPoints, cols] = size(data);

    sumActual = 0;
    numActuals = 0;
    for i = 1:numDataPoints
        x = data(i,6:cols)';
        prediction = predictedWeightVector'*x;
        actuals(i, 1) = 0;
        
        if(data(i, 5) == labelToClassify)
            actuals(i, 1) = 1;
            sumActual = sumActual + prediction;
            numActuals = numActuals + 1;
        end
        
        continuousLabels(i, 1) = prediction;
        
    end
    
    maxValue = max(continuousLabels);
    minValue = min(continuousLabels);
    
    averageActual = sumActual / numActuals;
    
    continuousLabels = (continuousLabels - minValue) .* 1/(maxValue - minValue);
    averageActual = (averageActual - minValue)*(1/(maxValue - minValue));
    for i = 1:numDataPoints
        prediction = continuousLabels(i, 1);
        if(prediction >= averageActual - 0.05)
            prediction = 1;
        else
            prediction = 0;
        end
            
        predictedLabels(i, 1) = prediction;
        errors(i, 1) = actuals(i, 1) - prediction;
    end
end

